package com.solve.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.solve.dao.ResourceClassificationMapper;
import com.solve.entity.ResourceClassification;
import com.solve.entity.ResourceClassificationExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ResourceClassificationServiceImpl {
    @Resource
    private ResourceClassificationMapper resourceClassificationMapper;

   public PageInfo selectResourceClassification(ResourceClassification resourceClassification){
        PageHelper.startPage(1,100);
        ResourceClassificationExample resourceClassificationExample = new ResourceClassificationExample();
        List<ResourceClassification> topicClassificationList = resourceClassificationMapper.selectByExample(resourceClassificationExample);
        PageInfo<ResourceClassification> pageInfo = new PageInfo<ResourceClassification>(topicClassificationList);
        return pageInfo;
    }

   /*  public List<TopicClassification> selectTopicClassificationListByTree(TopicClassification topicClassification){
        topicClassification.setUuid("0");
        //查询到顶级节点
        List<Re> topicClassificationList = resourceInfoUserMapper.selectTopicClassificationByParent(topicClassification.getUuid());
        for(TopicClassification top: topicClassificationList){
            List<TopicClassification> childrens = topicClassificationMapper.selectTopicClassificationByParent(top.getUuid());
            top.setTopicClassificationList(childrens);
        }
        return topicClassificationList;
    }*/

}
